{extend name="public/base" /}
{block name="title"}后台管理员{/block}
{block name="content"}
<div class="layui-fluid">   
  <div class="layui-card">
    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
      <div class="layui-form-item asuma-form-item">
        <div class="layui-inline">
          <label class="layui-form-label">登录名</label>
          <div class="layui-input-block">
            <input type="text" name="username" placeholder="用户名/手机号/邮箱" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">姓名</label>
          <div class="layui-input-block">
            <input type="text" name="truename" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">角色</label>
          <div class="layui-input-block">
            <select name="role">
              <option></option>
              {volist name="roles" id="vo"}
              <option value="{$vo.id}">{$vo.title}</option>
              {/volist}
            </select>
          </div>
        </div>
        <div class="layui-inline">
          <button class="layui-btn layui-btn-asuma layuiadmin-btn-admin" lay-submit lay-filter="admin-search">
            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
          </button>
        </div>
      </div>
    </div>
    
    <div class="layui-card-body">
      <div style="padding-bottom: 10px;" id="addOpt" data-url="{:url('adminEdit')}">
        <button class="layui-btn layui-btn-asuma layuiadmin-btn-admin" data-type="add">添加</button>
      </div>
      
      <table id="udzan-admin" lay-filter="udzan-admin" data-url="{:url('adminList')}" data-sturl="{:url('changeAdminStatus')}"></table>  
      
    </div>
  </div>
</div>
<input type="hidden" name="a" id="optInsert" data-url="{:url('pulladmin')}">
<input type="hidden" name="b" id="optUpdate" data-url="{:url('updateAdmin')}">
{/block}
{block name="footjs"}
<script type="text/html" id="statusTpl">
  {{# if(d.id == 1){ }}
  <button class="layui-btn layui-btn-xs layui-btn-primary status-btn">开启</button>
  {{# }else{ }}
  <input type="checkbox" name="status" value="{{d.id}}" data-name="{{d.login_name}}" title="开启" lay-filter="optstatus" {{d.status == 1 ? 'checked' : ''}}>
  {{# } }}
</script>
<script type="text/html" id="optTpl">
  <a class="layui-btn layui-btn-asuma layui-btn-xs" lay-event="edit">编辑</a>
  {{# if(d.id == 1){ }}
  <a class="layui-btn layui-btn-disabled layui-btn-xs" >删除</a>
  {{# }else{ }}
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
  {{# } }}
</script>
<script type="text/javascript" src="__STATIC__/mod/admin/authset/admins.js"></script>
{/block}